3.11.21 \(\int \frac {(-a+b x^n)^p (a+b x^n)^p}{x} \, dx\) [1021]

Optimal. Leaf size=72 \[ -\frac {\left (-a+b x^n\right )^p \left (a+b x^n\right )^p \left (a^2-b^2 x^{2 n}\right ) \, _2F_1\left (1,1+p;2+p;1-\frac {b^2 x^{2 n}}{a^2}\right )}{2 a^2 n (1+p)} \]

[Out]

-1/2*(-a+b*x^n)^p*(a+b*x^n)^p*(a^2-b^2*x^(2*n))*hypergeom([1, 1+p],[2+p],1-b^2*x^(2*n)/a^2)/a^2/n/(1+p)

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {273, 127, 272, 67} \begin {gather*} -\frac {\left (a^2-b^2 x^{2 n}\right ) \left (b x^n-a\right )^p \left (a+b x^n\right )^p \, _2F_1\left (1,p+1;p+2;1-\frac {b^2 x^{2 n}}{a^2}\right )}{2 a^2 n (p+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((-a + b*x^n)^p*(a + b*x^n)^p)/x,x]

[Out]

-1/2*((-a + b*x^n)^p*(a + b*x^n)^p*(a^2 - b^2*x^(2*n))*Hypergeometric2F1[1, 1 + p, 2 + p, 1 - (b^2*x^(2*n))/a^
2])/(a^2*n*(1 + p))

Rule 67

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((c + d*x)^(n + 1)/(d*(n + 1)*(-d/(b*c))^m))
*Hypergeometric2F1[-m, n + 1, n + 2, 1 + d*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[n] && (Intege
rQ[m] || GtQ[-d/(b*c), 0])

Rule 127

Int[((f_.)*(x_))^(p_.)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Dist[(a + b*x)^Frac
Part[m]*((c + d*x)^FracPart[m]/(a*c + b*d*x^2)^FracPart[m]), Int[(a*c + b*d*x^2)^m*(f*x)^p, x], x] /; FreeQ[{a
, b, c, d, f, m, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[n, m]

Rule 272

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 273

Int[(x_)^(m_.)*((a1_) + (b1_.)*(x_)^(n_))^(p_)*((a2_) + (b2_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[I
nt[x^(Simplify[(m + 1)/n] - 1)*(a1 + b1*x)^p*(a2 + b2*x)^p, x], x, x^n], x] /; FreeQ[{a1, b1, a2, b2, m, n, p}
, x] && EqQ[a2*b1 + a1*b2, 0] && IntegerQ[Simplify[(m + 1)/(2*n)]]

Rubi steps

\begin {align*} \int \frac {\left (-a+b x^n\right )^p \left (a+b x^n\right )^p}{x} \, dx &=\frac {\text {Subst}\left (\int \frac {(-a+b x)^p (a+b x)^p}{x} \, dx,x,x^n\right )}{n}\\ &=\frac {\left (\left (-a+b x^n\right )^p \left (a+b x^n\right )^p \left (-a^2+b^2 x^{2 n}\right )^{-p}\right ) \text {Subst}\left (\int \frac {\left (-a^2+b^2 x^2\right )^p}{x} \, dx,x,x^n\right )}{n}\\ &=\frac {\left (\left (-a+b x^n\right )^p \left (a+b x^n\right )^p \left (-a^2+b^2 x^{2 n}\right )^{-p}\right ) \text {Subst}\left (\int \frac {\left (-a^2+b^2 x\right )^p}{x} \, dx,x,x^{2 n}\right )}{2 n}\\ &=-\frac {\left (-a+b x^n\right )^p \left (a+b x^n\right )^p \left (a^2-b^2 x^{2 n}\right ) \, _2F_1\left (1,1+p;2+p;1-\frac {b^2 x^{2 n}}{a^2}\right )}{2 a^2 n (1+p)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 73, normalized size = 1.01 \begin {gather*} \frac {\left (-a+b x^n\right )^p \left (a+b x^n\right )^p \left (-a^2+b^2 x^{2 n}\right ) \, _2F_1\left (1,1+p;2+p;1-\frac {b^2 x^{2 n}}{a^2}\right )}{2 a^2 n (1+p)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((-a + b*x^n)^p*(a + b*x^n)^p)/x,x]

[Out]

((-a + b*x^n)^p*(a + b*x^n)^p*(-a^2 + b^2*x^(2*n))*Hypergeometric2F1[1, 1 + p, 2 + p, 1 - (b^2*x^(2*n))/a^2])/
(2*a^2*n*(1 + p))

________________________________________________________________________________________

Maple [F]
time = 0.13, size = 0, normalized size = 0.00 \[\int \frac {\left (b \,x^{n}-a \right )^{p} \left (a +b \,x^{n}\right )^{p}}{x}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^n-a)^p*(a+b*x^n)^p/x,x)

[Out]

int((b*x^n-a)^p*(a+b*x^n)^p/x,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*x^n)^p*(a+b*x^n)^p/x,x, algorithm="maxima")

[Out]

integrate((b*x^n + a)^p*(b*x^n - a)^p/x, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*x^n)^p*(a+b*x^n)^p/x,x, algorithm="fricas")

[Out]

integral((b*x^n + a)^p*(b*x^n - a)^p/x, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (- a + b x^{n}\right )^{p} \left (a + b x^{n}\right )^{p}}{x}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*x**n)**p*(a+b*x**n)**p/x,x)

[Out]

Integral((-a + b*x**n)**p*(a + b*x**n)**p/x, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*x^n)^p*(a+b*x^n)^p/x,x, algorithm="giac")

[Out]

integrate((b*x^n + a)^p*(b*x^n - a)^p/x, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+b\,x^n\right )}^p\,{\left (b\,x^n-a\right )}^p}{x} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((a + b*x^n)^p*(b*x^n - a)^p)/x,x)

[Out]

int(((a + b*x^n)^p*(b*x^n - a)^p)/x, x)

________________________________________________________________________________________